#ifndef	_FLASH_PARAM_H
#define	_FLASH_PARAM_H

#include "task_shell.h"

typedef struct _SCALE_T
{
	uint8_t ch;
	// pwm = (t - t_on) * k >> 8;
	int8_t t_on;
	uint8_t k;
	// t = (p * v) >> s + q
	uint8_t s;
	int16_t p;
	int16_t q;
} SCALE_T;

extern SCALE_T g_scale[];

void read_all_parameter(uint8_t channel, param_t param);
void set_parameter_temp(uint8_t channel, param_t param);
void set_parameter_fan(uint8_t channel, param_t param);
void save_parameter(uint8_t channel, param_t param);
void read_parameter(uint8_t channel, param_t param);
void reset_all_scale(uint8_t channel, param_t param);
void load_scales(void);

#endif	//_FLASH_PARAM_H


